import { TaskBase } from '@/global/creep-task/TaskBase';
import { MoveOpt } from '@/global/move/types';

declare global {
    /// move
    interface Creep {
        goTo(target: RoomPosition | { pos: RoomPosition }, options?: MoveOpt): ScreepsReturnCode;
    }
    /// task
    interface Creep {
        addTask(serializedTaskObj: TaskBase): void;
        runTask():
            | OK                // 成功执行并执行完毕
            | ERR_UNFINISHED    // 成功执行但没有结束
            | ERR_NOT_IN_RANGE  // 不在范围之内
            | ERR_NOT_FOUND     // 没有找到 task
            | ERR_BUSY;         // 被 suspend 了或还在 spawning
        isIdle(): boolean;
        isSuspended(): boolean;
        makeSuspend(ticks: number): void;
        declareTargeting(): void;
    }
    /// misc
    interface Creep {
        getStoredAmount(): number;
    }
}